package com.collectionAndMap.collection.set;

import java.util.TreeSet;

/***
 * @ClassName: TreeSetDemo
 * @Description: TerrSet  红黑树  有序的
 * 元素必须实现Comparable接口
 * @Auther: 送一一块二向箔
 * @Date: 16:12 2022/2/17
 * @version : V1.0
 */
public class TreeSetDemo {
    public static void main(String[] args) {
        TreeSet<Boy> set = new TreeSet<>();
        Boy b1 = new Boy("aca", 3);
        Boy b2 = new Boy("aba", 4);
        Boy b3 = new Boy("ccc", 1);
        set.add(b1);
        set.add(b2);
        set.add(b3);
        System.out.println(set.toString());
    }
}
